﻿<cms-modal-dialog-container cms-modal-size="large">

    <cms-modal-dialog-header>
        Upload an image
    </cms-modal-dialog-header>

    <cms-form cms-name="mainForm" ng-submit="onUpload()">
        <cms-page-actions>

            <cms-button cms-text="Upload" ng-click="onUpload()" class="main-cta" ng-disabled="mainForm.$invalid || saveLoadState.isLoading"></cms-button>
            <cms-button cms-text="Cancel" ng-click="onCancel()"></cms-button>

        </cms-page-actions>

        <cms-page-body>

            <cms-warning-message ng-if="isFilterSet">This image field has restrictions: {{filterText}}</cms-warning-message>

            <cms-form-section cms-title="Image details">

                <cms-form-field-image-upload cms-title="File"
                                             cms-model="command.file"
                                             cms-load-state="saveLoadState"
                                             cms-filter="filter"
                                             required></cms-form-field-image-upload>

                <cms-form-field-text cms-title="Title"
                                     cms-model="command.title"
                                     max-length="130"
                                     required></cms-form-field-text>

                <cms-form-field-tags cms-title="CMS Tags"
                                     cms-model="command.tags"></cms-form-field-tags>

                <cms-form-field-image-anchor-location-selector cms-model="command.defaultAnchorLocation"></cms-form-field-image-anchor-location-selector>

            </cms-form-section>

        </cms-page-body>
    </cms-form>

</cms-modal-dialog-container>